package com.example.springboot.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;


@Data
public class Admin {
    private Integer id;

    private String username;

    private String password;

    private String nickName;

    private String headImgUrl;

    private String phone;

    private Integer sex;

    @TableField(exist = false)
    private String sexName;

    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableLogic
    private Integer deleted;

    @TableField(exist = false)
    private Integer roleId;

    public String getSexName() {
        return this.sex == 1 ? "男" : "女";
    }

}
